//
//  YKPerformanceManageItemCell.m
//  YunKang
//
//  Created by leoking870 on 2017/10/17.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKPerformanceManageItemCell.h"
#import "YKDashView.h"
@interface YKPerformanceManageItemCell ()
@property (weak, nonatomic) IBOutlet UILabel *operatorLabel;
@property (weak, nonatomic) IBOutlet UILabel *performanceLabel;
@property (weak, nonatomic) IBOutlet UILabel *rankLabel;

@end

@implementation YKPerformanceManageItemCell
@dynamic tableViewItem;

- (void)cellLoadSubViews {
    [super cellLoadSubViews];
    self.operatorLabel.tf_weight = 1;
    self.performanceLabel.tf_weight = 1;
    self.rankLabel.tf_weight = 1;
    self.operatorLabel.textAlignment = NSTextAlignmentCenter;
    self.performanceLabel.textAlignment = NSTextAlignmentCenter;
    self.rankLabel.textAlignment = NSTextAlignmentCenter;
    [@[self.operatorLabel, self.performanceLabel, self.rankLabel] mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.top.equalTo(self.contentView.mas_top).offset(11);
    }];
    
    [@[self.operatorLabel, self.performanceLabel, self.rankLabel] mas_alignWeightlyAlongAxis:MASAxisTypeHorizontal
                                                                                        fixedSpace:@8
                                                                                         leadingTo:self.contentView.mas_leading
                                                                                         leadSpace:13
                                                                                        trailingTo:self.contentView.mas_trailing
                                                                                         tailSpace:0];
    
    YKDashView* dashView = [[YKDashView alloc]init];
    dashView.lineWidth = .5f;
    dashView.lineColor = [UIColor tf_colorWithHexString:@"#d4d4d4"];
    dashView.dashLineLength = 3;
    [self addSubview:dashView];
    [dashView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.bottom.trailing.equalTo(self);
        make.height.mas_equalTo(1);
    }];
}

- (void)cellWillAppear {
    [super cellWillAppear];
    
    self.operatorLabel.text = self.tableViewItem.model.USER_NAME;
    self.performanceLabel.text = self.tableViewItem.model.INTEGRA;
    self.rankLabel.text = self.tableViewItem.model.RANKING;
}

@end
